package com.sishu.websocket4.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sishu.websocket4.pojo.buyRecord;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface buyRecordMapper extends BaseMapper<buyRecord> {


    @Select("select * from buyRecord where user_id = #{userId} and site_id = #{siteId}")
       buyRecord selectbyuserid(String userId,String groupId,String siteId);

    @Select("select * from buyRecord where site_id = #{siteId}")
        List<buyRecord> selectbysiteId(String siteId);

    @Select("select * from buyRecord where site_id = #{siteId} and user_id = #{userId}")
    buyRecord selectbysiteIdanduserid(String userId,String siteId);

    @Delete("delete from buyRecord where user_id = #{userId} and site_id = #{siteid}")
    void deletegroud(String userId,String siteid);


}
